$(document).ready(function() {
    $('#show-tables').click(function(e) {
        $('#tables').slideUp()

        var year = parseInt($('#year-input').val())

        if(!year || year <=0 || year >= 9999)
            return

        var week = parseInt($('#week-input').val())
        if(!week || week <=0 || week > 52)
            return

        var data = {
            year: year
            , week: week
        }

        $.get('/backend/plan/weekly', data, function(html) {
            $('#tables').html(html).slideDown()
        })
    })
})
